<template>
	<view>
		<u-navbar :is-back="false" title="　" :border-bottom="false">
			<view class="u-flex u-row-right" style="width: 100%;">
				<view class="camera u-flex u-row-center">
					<u-icon name="camera-fill" color="#000000" size="48"></u-icon>
				</view>
			</view>
		</u-navbar>
		<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30">
			<view class="u-m-r-10">
				<u-avatar :src="baseurl+userinfo.avatar" size="140"></u-avatar>
			</view>
			<view class="u-flex-1">
				<view class="u-font-18 u-p-b-20">{{userinfo.realname}}</view>
				<view class="u-font-14 u-tips-color">手机号：{{userinfo.mobile}}</view>
			</view>
		<!-- <view class="u-m-l-10 u-p-10">
				<u-icon name="scan" color="#969799" size="28"></u-icon>
			</view>
			<view class="u-m-l-10 u-p-10">
				<u-icon name="arrow-right" color="#969799" size="28"></u-icon>
			</view> -->
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group>
				<navigator url="/pages/user/register" >
			       	<u-cell-item icon="rmb-circle" title="修改资料"></u-cell-item>
				</navigator>
			</u-cell-group>
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group>
				<navigator url="../school/student" >
				<u-cell-item icon="star" title="分配学生"></u-cell-item>
				</navigator>
				<navigator url="../school/list" >
				   <u-cell-item icon="list" title="班级列表"></u-cell-item>
				</navigator>
				<navigator url="../finance/price" >
				   <u-cell-item icon="coupon" title="定价管理"></u-cell-item>
				</navigator>
	<!-- 			<u-cell-item icon="photo" title="相册"></u-cell-item>
				<u-cell-item icon="coupon" title="卡券"></u-cell-item>
				<u-cell-item icon="heart" title="关注"></u-cell-item> -->
			</u-cell-group>
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="setting" @click="logout" title="退出"></u-cell-item>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				baseUrl:'',
				pic:'https://uviewui.com/common/logo.png',
				show:true,
				userinfo:'',
			}
		},
		onLoad() {
			 this.baseurl =  this.$u.http.config.baseUrl
			 this.userinfo = uni.getStorageSync('userinfo');
		},
		methods: {
			logout(){
				uni.removeStorageSync("token")
				uni.removeStorageSync("userinfo")
				uni.redirectTo({
					url:'../login/login'
				})
			}
		}
	}
</script>

<style lang="scss">
page{
	background-color: #ededed;
}

.camera{
	width: 54px;
	height: 44px;
	
	&:active{
		background-color: #ededed;
	}
}
.user-box{
	background-color: #fff;
}
</style>
